home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / monochrome.swf / scripts / frame_15 / PlaceObject2_330_14 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2005-08-26  |  969 b   |  40 lines

  1. onClipEvent(enterFrame){
  2.    if(_name != "shipA")
  3.    {
  4.       xspeed = speed * Math.sin((_rotation * -1 + 180) * 0.017453292519943295);
  5.       yspeed = speed * Math.cos((_rotation * -1 + 180) * 0.017453292519943295);
  6.       _X = _X + xspeed;
  7.       _Y = _Y + yspeed;
  8.       _rotation = _rotation + rspeed * speed;
  9.       xx = random(30);
  10.       if(xx == 0)
  11.       {
  12.          rspeed *= -1;
  13.       }
  14.       if(_X < -100 || _X > 650 || _Y < -100 || _Y > 500 || _root.rem == true)
  15.       {
  16.          removeMovieClip(this);
  17.       }
  18.       var i = 0;
  19.       while(i <= 20)
  20.       {
  21.          if(sh.harea.hitTest(_root["hmn" + i]))
  22.          {
  23.             life -= _root["hmn" + i].dmg;
  24.             sh.play();
  25.             removeMovieClip(_root["hmn" + i]);
  26.          }
  27.          i++;
  28.       }
  29.       if(_root.ship.sh.hitTest(_X,_Y,false))
  30.       {
  31.          play();
  32.          _root.ship.play();
  33.       }
  34.       if(life <= 0)
  35.       {
  36.          play();
  37.       }
  38.    }
  39. }
  40.